<template>
  <div class="contrainer">
    <el-table :data="tableData" style="width: 100%; margin-top: 10px;" @selection-change="totalChange" :row-class-name="tableRowClassName" v-loading="loadding">
    <el-table-column type="selection" width="50"></el-table-column>
      <template v-for="(item,index) in tableColData">
        <el-table-column
          v-if="item.name==='status'"
          :prop="item.prop"
          :label="item.label"
          :key="index"
          :width="item.width"
          align="center"
          :sortable="item.sortable || false"
        ></el-table-column
>
          <template slot-scope="scope">
            <span v-if="scope.row.statusCh == '正常'" class="greedColor">{{scope.row.statusCh}}</span>
            <span v-else class="redColor">{{scope.row.statusCh}}</span>
          </template>
        </el-table-column>
        <el-table-column
          v-else-if="item.name==='username'"
          :prop="item.prop"
          :label="item.label"
          :key="item.prop"
          :width="item.width"
          align="center"
          :sortable="item.sortable || false"
        >
          <template slot-scope="scope">
            <el-tooltip class="item" effect="dark" :content="scope.row.username" placement="top">
              <div class="names_">{{scope.row.username}}</div>
            </el-tooltip>
          </template>
        </el-table-column>
        <el-table-column
          v-else
          :prop="item.prop"
          :label="item.label"
          :key="item.label"
          :width="item.width"
          align="center"
          :sortable="item.sortable || false"
        >
        </el-table-column>
      </template>
    </el-table>
  </div>
</template>
<script>
export default{
  props: {
    tableData: Array,
    tableColData: Array,
    loadding:Boolean
  },
  data() {
    return {};
  },
};
</script>
